package com.example.designPrinciples;

import java.util.ArrayList;

/**
 * @Title: Demo
 * @Description: TODO
 * @Date 2021/9/29 16:35
 */
public class Demo {


    public static void main(String[] args) {
        /*Superclass superclass = new Superclass();
        superclass.add(3, 2);
        Son son = new Son();
        son.add(3, 2);*/


        ArrayList list = new ArrayList();
        Superclass superclass = new Superclass();
        Son son = new Son();
        System.out.print("使用父类对象调用的结果：");
        superclass.method(list);
        System.out.print("将父类对象替换成子类对象后的调用结果：");
        son.method(list);
    }

}
